
const { ProcessMgr } = require("./processMgr");
const { SIGNAL_DEFINE } = require("./signal");

class ShowCardProcessMgr extends ProcessMgr {
    constructor() {
        super();
        this.showCardTime = 0;
        this.cardMgr = null;
    }

    setCardMgr(cardMgr) {
        this.cardMgr = cardMgr;
    }

    setGameMgr(gameMgr) {
        super.setGameMgr(gameMgr);
        this.showCardTime = gameMgr.showCardTime;
    }

    doAction() {
        this.signal.emit(SIGNAL_DEFINE.SHOW_CARD);
        setTimeout(this.doNextAction(), this.showCardTime * 1000);
    }
}

exports.ShowCardProcessMgr = ShowCardProcessMgr;